
#ifndef HISTOGRAMPLOTER_H
#define HISTOGRAMPLOTER_H

#include <qwt_plot.h>

class GraphicsScene;
class QwtPlotGrid;

class HrmPrimitive
{
public:
    float value;
    int harmonicNumber;
    int num;
};

class HistogramPloter : public QwtPlot
{
    Q_OBJECT

    QwtLegend * legend;
    GraphicsScene * scene;
    bool withSpaces;
    bool byID;

    QHash< int, QList< float > > * hrmHash;

    QwtPlotGrid * grid;

public:
    explicit HistogramPloter( GraphicsScene * s = 0, QHash< int, QList< float > > * hData = 0, QWidget * parent = NULL );
    virtual ~HistogramPloter()
    {
        delete legend;
        delete grid;
    }

    QHash< int, QList< float > > * ForAllNodes( bool byNodeIDs = false ) { byID = byNodeIDs; populate(); return hrmHash; }
    void ForNode( int id );
    void PlotWithSpaces( bool s ) { withSpaces = s; }

private:
    void populate();

private slots:
    void showItem( QwtPlotItem * it, bool on );

};

#endif // HISTOGRAMPLOTER_H
